package org.codeart.chainrespon.example02;

import org.codeart.chainrespon.pojo.AuthInfo;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Client {

    public static void main(String[] args) throws ParseException {
        AuthController controller = new AuthController();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date authDate = formatter.parse("2024-02-29 00:00:00");
        AuthInfo authInfo;
        authInfo = controller.doAuth("洛必达", "00646413246113214", authDate);
        System.out.println("当前审核状态: " + authInfo.getInfo());
        System.out.println("=======================================");
        
        AuthService.auth("1000013", "00646413246113214");
        authInfo = controller.doAuth("洛必达", "00646413246113214", authDate);
        System.out.println("当前审核状态: " + authInfo.getInfo());
        System.out.println("三级审批负责人审批完成, 审批人: 伯努利");
        System.out.println("=======================================");

        AuthService.auth("1000012", "00646413246113214");
        authInfo = controller.doAuth("洛必达", "00646413246113214", authDate);
        System.out.println("当前审核状态: " + authInfo.getInfo());
        System.out.println("二级审批负责人审批完成, 审批人: 高斯");
        System.out.println("=======================================");

        AuthService.auth("1000011", "00646413246113214");
        authInfo = controller.doAuth("洛必达", "00646413246113214", authDate);
        System.out.println("当前审核状态: " + authInfo.getInfo());
        System.out.println("一级审批负责人审批完成, 审批人: 欧拉");
        System.out.println("=======================================");

        AuthInfo authInfo1 = controller.doAuth("洛必达", "00646413246113214", authDate);
        System.out.println("当前审核状态: " + authInfo1.getInfo());
    }

}
